package 最长回文串;

class Solution {
    public int longestPalindrome(String s) {
        int n = s.length();
        int[] hash = new int[127];
        for (int i = 0; i < n; i++) {
            hash[s.charAt(i)]++;
        }
        int ret = 0;
        for (int x : hash) {
            ret += x / 2 * 2;
        }
        ret += n > ret ? 1 : 0;
        return ret;
    }
}